package com.zkdcloud.dto;

import com.xdja.interceptor.bean.ResultBean;
import lombok.Data;

import java.util.List;

/**
 * 终端分页返回结果
 *
 * @author zk123
 * @version 2018/5/15
 */
@Data
public class TerminalResultsPage<T> extends ResultBean<T>{
    /**
     * 数据列表
     */
    private List<T> items;
    /**
     * 分页数据
     */
    private Meta _meta;

    @Data
    public class Meta {
        public int totalCount;
        public int pageCount;
        public int currentPage;
        public int perPage;
    }

    public TerminalResultsPage(){

    }
    public TerminalResultsPage(Integer totalCount, Integer pageCount, Integer currentPage, Integer perPage){
        Meta meta = new Meta();
        meta.setCurrentPage(currentPage);
        meta.setTotalCount(totalCount);
        meta.setPageCount(pageCount);
        meta.setPerPage(perPage);
        this._meta = meta;
    }
}
